package com.atguigu.jinx.entity.vo;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.io.Serializable;

/**
 * Author:VEGA_KUANGQI
 * <p>
 * 2025/8/9
 */
@Data
public class UserVO implements Serializable {

    private static final long serialVersionUID = 1L;

    private static final String MESSAGE = "不得为空";
    private static final String USER_NAME = "用户名";
    private static final String NICK_NAME = "昵称";
    private static final String PASSWORD = "密码";
    private static final String PHONE = "手机号";
    private static final String EMAIL = "邮箱";


    /**
     * 用户昵称
     */
    @NotBlank(message = NICK_NAME + MESSAGE)
    private String nickname;


    /**
     * 用户名
     */
    @NotBlank(message = USER_NAME + MESSAGE)
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = PASSWORD + MESSAGE)
    @Pattern(
            regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d@#$%^&*!]{8,}$",
            message = "密码至少8位，且包含字母和数字"
    )
    private String password;


    /**
     * 手机号
     */
    @NotBlank(message = PHONE + MESSAGE)
    @Pattern(regexp = "^(1[3-9]\\d{9}|0\\d{9,10})$", message = "手机号格式不正确")
    private String phone;

    /**
     * 邮箱
     */
    @NotBlank(message = EMAIL + MESSAGE)
    @Email(message = "邮箱格式不正确")
    private String email;

    /**
     * 是否是会员
     */
    private Boolean isMember = false;


    /**
     * 问卷调查
     */
    private String surveyResult;
}
